import { http } from "@/utils/http.js";

// 代付列表
export const negotiationApi = (data) => {
  return http.request({
    method: "GET",
    url: "order/negotiation",
    data: data,
  });
};

// 拒绝
export const negRefuseApi = (data) => {
  return http.request({
    method: "POST",
    url: "order/negRefuse",
    data: data,
  });
};

// 撤回
export const negCancelApi = (data) => {
  return http.request({
    method: "POST",
    url: "order/negCancel",
    data: data,
  });
};

// 支付代付
export const negPayApi = (data) => {
  return http.request({
    method: "POST",
    url: "order/negPay",
    data: data,
  });
};

// 创建代付记录
export const negCreateApi = (data) => {
  return http.request({
    method: "POST",
    url: "order/negCreate",
    data: data,
  });
};

// 代付订单详情
export const negDetailsApi = (data) => {
  return http.request({
    method: "GET",
    url: "order/negDetails",
    params: {
      ...data,
      //   offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

// 我的客户数据
export const orderlist = (data) => {
  return http.request({
    method: "get",
    url: "/order/product/list",
    params: {
      ...data,
      //   offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

// 订单详情
export const orderdetail = (data) => {
  return http.request({
    method: "get",
    url: "/order/product/detail",
    params: {
      ...data,
      //   offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

export const refundreason = (data) => {
  return http.request({
    method: "get",
    url: "/order/refund/reason",
    params: {
      ...data,
      //   offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

// 退款认证
export const refundcheck = (data) => {
  return http.request({
    method: "post",
    url: "/order/refund/check",
    data: {
      ...data,
      //   offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

// 退款认证
export const refundcreate = (data) => {
  return http.request({
    method: "post",
    url: "/order/refund/create",
    data: {
      ...data,
      //   offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

export const refundlist = (data) => {
  return http.request({
    method: "get",
    url: "/order/refund/list",
    params: {
      ...data,
      //   offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

export const refunddetail = (data) => {
  return http.request({
    method: "get",
    url: "/order/refund/detail",
    params: {
      ...data,
      //   offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

export const refundexpress = (data) => {
  return http.request({
    method: "get",
    url: "/order/refund/express",
    params: {
      ...data,
      //   offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

export const refundcancel = (data) => {
  return http.request({
    method: "post",
    url: "/order/refund/cancel",
    data: {
      ...data,
      //   offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

// 退款认证
export const refunddelivery = (data) => {
  return http.request({
    method: "post",
    url: "/order/refund/delivery",
    data: {
      ...data,
      //   offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

// 代付前置页
export const negUpPageApi = (data) => {
  return http.request({
    method: "get",
    url: "order/negUpPage",
    data: {
      ...data,
      //   offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

// export const refunddelivery = (data) => {
//   return http.request({
//     method: "post",
//     url: "/order/refund/delivery",
//     data: {
//       ...data,
//       //   offLoading: true, // 加参数关闭api请求全局加载中提示
//     },
//   });
// };

export const orderexpress = (data) => {
  return http.request({
    method: "get",
    url: "/order/express",
    params: {
      ...data,
      //   offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

export const offlinePayApi = (data) => {
  return http.request({
    method: "get",
    url: "/order/offlinePay",
    params: {
      ...data,
      //   offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

export const orderpayState = (data) => {
  return http.request({
    method: "get",
    url: "/order/payState",
    params: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

export const traceInfo = (data) => {
  return http.request({
    method: "get",
    url: "/order/traceInfo",
    params: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

export const shopOrder = (data) => {
  return http.request({
    method: "get",
    url: "/shop/order",
    params: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

export const shopOrderDetail = (data) => {
  return http.request({
    method: "get",
    url: "/shop/orderDetail",
    params: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

export const shopDeliver = (data) => {
  return http.request({
    method: "post",
    url: "/shop/deliver",
    data: {
      ...data,
      //   offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};
